﻿using System;


namespace StagingAreaETL
{
    internal class RatingsAGG
    {
        internal RatingsAGG(int studentKey, int startTermKey, int endTermKey, double rating)
        {
            if(endTermKey<startTermKey)
                throw new ArgumentOutOfRangeException("End term has lower KEY than start term");
            if(rating > 4 || rating < 1)
                throw new ArgumentOutOfRangeException("Summary rating must fall inside interval <1.0, 4.0>");

            StudentKEY = studentKey;
            StartTermKEY = startTermKey;
            EndTermKEY = endTermKey;
            SummaryRating = Math.Round(rating, 2);
        }

        internal readonly int StudentKEY;
        internal readonly int StartTermKEY;
        internal readonly int EndTermKEY;
        internal readonly double SummaryRating;
    }
}
